Build Vala support (.vapi file) by default
authorJon Nordby <jononor@gmail.com>
Wed, 3 Aug 2011 21:13:29 +0000 (23:13 +0200)
committerJon Nordby <jononor@gmail.com>
Wed, 3 Aug 2011 21:16:02 +0000 (23:16 +0200)
Generated from .gir file.

babl/.gitignore
babl/Makefile.am
configure.ac

index c7aeff3748253eb35a3a4cd54f56e4fae0f083a9..42ebfdbd39bb42ea93f60f0a2cd9acdf2bca2de4 100644 (file)
@@ -4,6 +4,7 @@
 /.libs
 /Babl-0.1.gir
 /Babl-0.1.typelib
+/*.vapi
 /Makefile
 /Makefile.in
 /babl-version.h
index e526e8a5263409a5f74e48ad1e526ba01b522d5b..8b48f106e4ee6f6f39cf8bc90f75b64b4896a7dc 100644 (file)
@@ -121,5 +121,13 @@ CLEANFILES = $(gir_DATA) $(typelibs_DATA)
         $(G_IR_COMPILER_OPTS) \
         $< -o $@
 
+if HAVE_VALA
+babl-$(BABL_API_VERSION).vapi: Babl-$(BABL_API_VERSION).gir
+       $(VAPIGEN) --library=babl-$(BABL_API_VERSION) Babl-$(BABL_API_VERSION).gir
+
+vapidir=@vapidir@
+vapi_DATA = babl-$(BABL_API_VERSION).vapi
+
+endif # HAVE_VALA
 
 endif # HAVE_INTROSPECTION
index 0c6c3921c88685c8cdedf557dfece240c39eae74..126b5e4a76935faf47b7d6bb3040f7b57df5a69e 100644 (file)
@@ -67,6 +67,27 @@ AC_SUBST(BABL_RELEASE)
 # GObject Introspection
 GOBJECT_INTROSPECTION_CHECK([0.6.8])
 
+# Vala
+AC_ARG_WITH(vala, [  --without-vala         build without Vala support])
+
+have_vapigen="no"
+if test "x$with_vala" != "xno"; then
+
+  AC_PATH_PROG(VAPIGEN, vapigen, no)
+  if test "$VAPIGEN" = "no"; then
+    have_vapigen="no  (vapigen executable not found)"
+    AC_MSG_RESULT([*** Check for vapigen failed.])
+  else
+    have_vapigen="yes"
+  fi
+fi
+
+have_vala=$have_vapigen
+AM_CONDITIONAL(HAVE_VALA, test "$have_vala" = "yes")
+
+vapidir=$(pkg-config --variable vapidir vala-1.0)
+AC_SUBST(vapidir)
+
 dnl The symbol BABL_UNSTABLE is defined above for substitution in
 dnl Makefiles and conditionally defined here as a preprocessor symbol
 dnl and automake conditional.